<%-- 
    Document   : index
    Created on : Dec 7, 2012, 12:51:47 PM
    Author     : doraemon
--%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>

<legend>
    User Listing
</legend>

<table class="table table-striped">
    <tr>
        <th>Name</th>
        <th>Email</th>
        <th>Phone</th>
        <th>Address</th>
        <th>Status</th>        
        <th>Action</th>
    </tr>

    <s:iterator value="users" var="user">
        <tr>
            <td><a href='<s:url action="AdminUser" />/show'><s:property value="#user.firstName" />&nbsp;<s:property value="#user.lastName" /></a></td>               
            <td><s:property value="#user.email" /></td>
            <td><s:property value="#user.phone" /></td>
            <td><s:property value="#user.address" /></td>
            <td><s:property value="#user.status" /></td>        
            <td>
                <s:url action="AdminUser/edit" var="editURL">
                    <s:param name="id" value="#user.id" />
                </s:url>
                <a href='<s:property value="#editURL" />'>Edit</a>&nbsp;
                <s:url action="AdminUser/delete" var="deleteURL">
                    <s:param name="id" value="#user.id" />
                </s:url>
                <a href='<s:property value="#deleteURL" />'>Delete</a>
            </td>
        </tr>
    </s:iterator>

</table>
<h4>  
    <a href='<s:url action="AdminUser" />/create'>Create a new user</a>  
</h4>  